#!/usr/bin/python env
#-*- coding: utf-8 -*-
#@Time   :2018/4/25 23:28
#@Author :huchao
from menu import show_menu
import student_info as st

def main():
    while True:
        show_menu()
        userinput = input("请选择需要的操作:")
        if userinput == "q":
            print("感谢您使用学生管理系统")
            break
        elif userinput == "1":
            st.inputStudentInfo()
        elif userinput == "2":
            st.outPutStudentlistOniter()
        elif userinput == "3":
            st.deletStudent()
        elif userinput == "4":
            st.updateStudent()
        elif userinput == "5":
            st.outPutStudentlistOniter(key="score",reverse=True)
            input("输入任意键继续操作")
        elif userinput == "6":
            st.outPutStudentlistOniter(key="score",reverse=False)
            input("输入任意键继续操作")
        elif userinput == "7":
            st.outPutStudentlistOniter(key="age",reverse=True)
            input("输入任意键继续操作")
        elif userinput == "8":
            st.outPutStudentlistOniter(key="age",reverse=False)
            input("输入任意键继续操作")
        elif userinput == "9":
            st.student_IO_Write()
        elif userinput == "10":
            st.get_student_for_file()



if __name__ == "__main__":
    main()